package cn.tedu.kcircle.check.admin.infra.repository;

import cn.tedu.kcircle.check.admin.dao.mapper.CheckLogAdminMapper;
import cn.tedu.kcircle.check.admin.infra.converter.CheckLogConverter;
import cn.tedu.kcircle.check.admin.protocol.param.CheckLogAddParam;
import cn.tedu.kcircle.check.admin.repository.model.CheckLogAddModel;
import cn.tedu.kcircle.check.admin.repository.persist.CheckLogRepository;
import cn.tedu.kcircle.check.admin.service.bo.CheckLogListItemBO;
import cn.tedu.kcircle.check.dao.entity.CheckLogDO;
import cn.tedu.kcircle.common.dto.ResourceDTO;
import cn.tedu.kcircle.common.po.PageData;
import cn.tedu.kcircle.common.util.TransPage;
import com.github.pagehelper.PageHelper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

import java.util.List;

@Slf4j
@Repository
@AllArgsConstructor
public class CheckLogRepositoryImpl implements CheckLogRepository {
    private CheckLogAdminMapper checkLogMapper;
    private CheckLogConverter converter;
    @Override
    public int insert(CheckLogAddModel checkLogAddModel) {
        log.debug("开始执行【插入审核日志】的数据访问，参数：{}", checkLogAddModel);
        CheckLogDO checkLogDO = converter.model2DO(checkLogAddModel);
        return checkLogMapper.insert(checkLogDO);
    }

    @Override
    public int deleteByResource(ResourceDTO resourceDTO) {
        log.debug("开始执行【根据资源删除审核日志】的数据访问，参数：{}", resourceDTO);
        return checkLogMapper.deleteResource(resourceDTO);
    }


}
